package com.gcit.seniorWish.core.base.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gcit.seniorWish.core.base.tips.ErrorTip;
import com.gcit.seniorWish.core.exception.GunsException;
import com.gcit.seniorWish.core.support.HttpKit;

/**
 * 全局的控制器
 *
 * @author fengshuonan
 * @date 2016年11月13日 下午11:04:45
 */
@Controller
@RequestMapping("/global")
public class GlobalController {

    /**
     * 跳转到404页面
     *
     * @author fengshuonan
     */
    @RequestMapping(path = "/error")
    public String errorPage() {
        return "/404.html";
    }

	/**
	 * 业务异常跳转页面
	 *
	 * @param model
	 * @return
	 */
	@RequestMapping(value = "/bussErrorHtml")
	public String bussError(Model model) {
		model.addAttribute("tips", HttpKit.getRequest().getAttribute("tips"));
		return "/400.html";
	}

    /**
     * 跳转到session超时页面
     *
     * @author fengshuonan
     */
    @RequestMapping(path = "/sessionError")
    public String errorPageInfo(Model model) {
        model.addAttribute("tips", "会话超时");
        return "/login.html";
    }
}
